package join;

public class Test {
    public static void main(String[] args)  {
        Thread t = new Thread(new Mythread1(),"线程1");
        t.start();
        for (int i = 0; i < 100; i++) {
            System.out.println(i);
            try {
                Thread.sleep(500);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
            if(i==50){
                try {
                    t.join();
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
            }

        }
    }

}
